﻿using System;
using System . Collections . Generic;
using System . Linq;
using System . Text;
using System . Threading . Tasks;
using System . Xml . Linq;

namespace GameClassLibrary . Buffs
{
    /// <summary>
    /// 指示绑定到玩家的效果(神灵)
    /// </summary>
    public class PlayerBuff : Buff
    {
        public Players . Player Target { get; private set; }

        public virtual bool BlockBuyStock { get; } = false;

        public virtual bool BlockSellStock { get; } = false;

        public virtual bool BlockBuyArea { get; } = false;

        public virtual bool BlockUpgradeBuilding { get; } = false;

        public virtual bool BlockGetCharge { get; } = false;

        public virtual bool FreeOfCharge { get; } = false;

        public virtual int AddTouzi { get; } = 0;

        public virtual bool UpgradeBuildngs { get; } = false;

        public virtual bool BadLuck { get; } = false;

        public virtual bool GoodLuck { get; } = false;

        //public virtual bool 

        public PlayerBuff ( Players . Player target )
        {
            Target = target;

            StartDate = Game . Current . Date;
        }

        public PlayerBuff ( XElement saving ) : base ( saving )
        {

        }

        public override void NextDay ( )
        {
            if ( Game . Current . Date == StartDate + UpTime )
            {
                Target . Buffs . Remove ( this );
            }
            base . NextDay ( );
        }
    }
}
